{include file='pub/base' /}
<link rel="stylesheet" type="text/css" href="__Flow__/workflow.3.0.css"/>
<link rel="stylesheet" type="text/css" href="__Flow__/multiselect2side.css"/>
<form  class="form-horizontal" action="{:url('save_attribute')}" method="post" name="form" id="form">
<input type="hidden" name="flow_id" value="{$one.flow_id}"/>
<input type="hidden" name="process_id" value="{$one.id}"/>
<table class="tables">
<tr><td>步骤名称</td><td><input type="text" class="smalls" name="process_name" value="{$one.process_name}"></td><td>步骤尺寸</td><td>
<input type="text" class="smalls" name="style_width" value="{$one.style.width}" style='width:60px'> X 
			<input type="text" class="smalls" name="style_height" value="{$one.style.height}" style='width:60px'></td></tr>
<tr></tr>
<tr><td>字体颜色</td><td  colspan='3'><input type="text" class="smalls" name="style_color" id="style_color" placeholder="#000000" value="{$one.style.color}">
            <div class="colors" org-bind="style_color">
                <ul>
                  <li class="Black active" org-data="#000" title="Black">1</li>
                  <li class="red" org-data="#d54e21" title="Red">2</li>
                  <li class="green" org-data="#78a300" title="Green">3</li>
                  <li class="blue" org-data="#0e76a8" title="Blue">4</li>
                  <li class="aero" org-data="#9cc2cb" title="Aero">5</li>
                  <li class="grey" org-data="#73716e" title="Grey">6</li>
                  <li class="orange" org-data="#f70" title="Orange">7</li>
                  <li class="yellow" org-data="#fc0" title="Yellow">8</li>
                  <li class="pink" org-data="#ff66b5" title="Pink">9</li>
                  <li class="purple" org-data="#6a5a8c" title="Purple">10</li>
                </ul>
            </div></td></tr>
			<tr><td>步骤类型</td><td>
				<input type="radio" name="process_type" value="is_step" {if condition="$one.process_type eq 'is_step'"}checked="checked"{/if}>正常步骤
                <input type="radio" name="process_type" value="is_one" {if condition="$one.process_type eq 'is_one'"}checked="checked"{/if}>第一步</td>
				<td>调用方法</td>
				<td>
					<input type="text" class="smalls" name="wf_action"  value="{$one.wf_action ?? 'view'}">
				</td>
				
				</tr>
				<tr><td>步骤模式</td><td  colspan='3'>
					<select name="wf_mode" id="wf_mode_id" datatype="*" nullmsg="请选择步骤模式">
					<option value="">请选择步骤模式</option>
					{if condition='count($one.process_to)>1'}
					 <option value="1" {if condition="$one['wf_mode'] eq 1"}selected="selected"{/if}>转出模式（符合执行）</option>
					 <option value="2" {if condition="$one['wf_mode'] eq 2"}selected="selected"{/if}>同步模式（均需办理）</option>
					 {else/}
					 <option value="0" {if condition="$one['wf_mode'] eq 0"}selected="selected"{/if}>单线模式（流程为直线型单一办理模式）</option>
					{/if}
				  </select>
				</td></tr>
			<tr><td>会签方式</td><td><select name="is_sing" >
              <option value="1" {if condition="$one.is_sing eq 1"}selected="selected"{/if}>允许会签</option>
              <option value="2" {if condition="$one.is_sing eq 2"}selected="selected"{/if}>禁止会签</option>
            </select></td>
			
			<td>回退方式</td><td><select name="is_back" >
              <option value="1" {if condition="$one.is_back eq 1"}selected="selected"{/if}>不允许</option>
              <option value="2" {if condition="$one.is_back eq 2"}selected="selected"{/if}>允许回退</option>
            </select></td>
			</tr>
			<tr><td>办理人员</td><td colspan='3'><select name="auto_person" id="auto_person_id" datatype="*" nullmsg="请选择办理人员或者角色！">
                <option value="">请选择办理人员或者角色</option>
				 {if condition="$one.process_type neq 'is_one'"}<option value="3" {if condition="$one['auto_person'] eq 3"}selected="selected"{/if}>自由选择</option>{/if}
				 <option value="4" {if condition="$one['auto_person'] eq 4"}selected="selected"{/if}>指定人员</option>
                <option value="5" {if condition="$one['auto_person'] eq 5"}selected="selected"{/if}>指定角色</option>
              </select>
              <span class="help-inline">*选择人员或者办理的角色！</span>
			<div id="auto_person_3" {if condition="$one['auto_person'] neq 3"}class="hide"{/if}>
              办理人
                    <input type="hidden" name="range_user_ids" id="range_user_ids" value="{$one.range_user_ids}">
                    <input class="input-xlarge" readonly="readonly" type="text" placeholder="选择办理人范围" name="range_user_text" id="range_user_text" value="{$one.range_user_text ?? ''}"> 
					<a class="btn" onclick="layer_show('办理人','{:url('super_user',['kid'=>'range_user'])}','350','500')">选择</a>
				
            </div>
            <div id="auto_person_4" {if condition="$one['auto_person'] neq 4"}class="hide"{/if}>
              办理人<input type="hidden" name="auto_sponsor_ids" id="auto_sponsor_ids" value="{$one.auto_sponsor_ids}">
                    <input class="input-xlarge" readonly="readonly" type="text" placeholder="指定办理人" name="auto_sponsor_text" id="auto_sponsor_text" value="{$one.auto_sponsor_text ?? ''}"> 
					<a class="btn" onclick="layer_show('办理人','{:url('super_user',['kid'=>'auto_sponsor'])}','350','500')">选择</a>
            </div>
            <div id="auto_person_5" {if condition="$one['auto_person'] neq 5"}class="hide"{/if}>
              指定角色
                    <input type="hidden" name="auto_role_ids" id="auto_role_value" value="{$one.auto_role_ids}" >
                    <input class="input-xlarge" readonly="readonly" type="text" placeholder="指定角色" name="auto_role_text" id="auto_role_text" value="{$one.auto_role_text ?? ''}">
					<a class="btn" onclick="layer_show('办理人','{:url('super_role')}','350','500')">选择</a>
               
            </div></td></tr>
<!--重新设计，带转出模式-->


<tr id='wf_mode_2' {if condition="$one['wf_mode'] neq 1"}class="hide"{/if}>
<td colspan=4>
<table class="table" >
      <thead>
        <tr>
          <th style="width:30px;">步骤</th>
          <th>转出条件设置</th>
        </tr>
      </thead>
      <tbody>

<!--模板-->
{volist name='process_to_list' id='k'}
{if condition="in_array($k['id'],$one['process_to'])"}
<tr>    
<td style="width: 30px;">{$k.process_name}{$k.id}</td>
<td>
    <table class="table table-condensed">
    <tbody>
      <tr>
        <td>
            <select id="field_{$k.id}" class="smalls">
              <option value="">选择字段</option>
			  {volist name='from' id='v'}
			  <option value="{$key}">{$v}</option>
			  {/volist}
            </select>
            <select id="condition_{$k.id}" class="smalls" style="width: 60px;">
				<option value="=">=</option>
				<option value="&lt;&gt;"><></option>
				<option value="&gt;">></option>
				<option value="&lt;"><</option>
				<option value="&gt;=">>=</option>
				<option value="&lt;="><=</option>
				<option value="include">含</option>
				<option value="exclude">不含</option>
            </select>
            <input type="text" id="item_value_{$k.id}" class="smalls" style="width: 40px;">
            <select id="relation_{$k.id}" class="smalls" style="width: 40px;"><option value="AND">AND</option><option value="OR">OR</option>
            </select>
        </td>
        <td>
			<button type="button" class="wf_btn" onclick="fnAddLeftParenthesis('{$k.id}')">（</button>
			<button type="button" class="wf_btn" onclick="fnAddRightParenthesis('{$k.id}')">）</button>
			<button type="button" onclick="fnAddConditions('{$k.id}')" class="wf_btn">新增</button>
        </td>
       </tr>
       <tr>
        <td>
            <select id="conList_{$k.id}" multiple="" style="width: 100%;height: 80px;">
			{$k.condition|raw}
			</select>
        </td>
        <td>
           
        <button type="button" onclick="fnDelCon('{$k.id}')" class="wf_btn">删行</button>
        <button type="button" onclick="fnClearCon('{$k.id}')" class="wf_btn">清空</button>
           <input name="process_in_set_{$k.id}" id="process_in_set_{$k.id}" type="hidden">
        </td>
      </tr>
     
    </tbody>
    </table>
</td>
</tr>
{/if}
{/volist}

  </tbody>
  
</table>
</td></tr>
</table>

    
<input type="hidden" name="process_condition" id="process_condition" value='{$one.process_tos}'>

<div>
  <hr/>
  <span class="pull-right">
      <a onclick="layer_close()" class="btn" >取消</a>
      <button  class="btn btn-primary radius" type="submit"><i class="Hui-iconfont">&#xe632;</i> 保存</button>
  </span>
</div>
</form>
<script type="text/javascript" src="__Flow__/jquery-1.7.2.min.js?"></script>

<script type="text/javascript" src="__Flow__/jquery-ui-1.9.2-min.js?" ></script>
<!--select 2-->
<script type="text/javascript" src="__Flow__/multiselect2side.js?" ></script>
<!--flowdesign-->
<script type="text/javascript" src="__Flow__/workflow-att.3.0.js"></script>


<script type="text/javascript" src="__LIB__/Validform/5.3.2/Validform.min.js"></script>
<script type="text/javascript">
$(function(){
	$("#form").Validform({
            tiptype:1,
            ajaxPost:true,
            showAllError:true,
            callback:function(ret){
                ajax_progress(ret);
            }
        });
});
var wf_mode = "{:isset($one.wf_mode)?$one.wf_mode:'0'}";
if(wf_mode ==1){
	check_from();	
}
</script>
